﻿#include "UserView.h"
#include <iostream>
#include "Utils.h"

void UserView::showUser(const UserInfo& playerInfo)
{
    Utils::clearBackGround();
    Utils::setCursorPsn(20, 11, "id:");
    std::cout << playerInfo.id;
    Utils::setCursorPsn(20, 13, "name:");
    std::cout << playerInfo.name;
    Utils::setCursorPsn(20, 15, "ico:");
    std::cout << playerInfo.ico;
    Utils::setCursorPsn(20, 17, "score:");
    for (short score : playerInfo.histroyScore)
    {
        std::cout << score << " ";
    }
}

const UserInfo UserView::createUser()
{
    Utils::clearBackGround();
    UserInfo playerInfo;
    Utils::setCursorPsn(35, 11, "input id :");
    std::cin >> playerInfo.id;
    Utils::clearBackGround();
    Utils::setCursorPsn(35, 11, "input name :");
    std::cin >> playerInfo.name;
    Utils::clearBackGround();
    Utils::setCursorPsn(35, 11, "input ico :");
    std::cin >> playerInfo.ico;
    return playerInfo;
}
